package cn.com.jinhao.provider.user.service.impl;

import cn.com.jinhao.provider.user.mapper.CommonMapper;
import org.apache.commons.lang3.StringUtils;

import javax.annotation.Resource;

/**
 * hotline-spring-cloud
 * <p>Description: </p>
 *
 * @author ShaneMew
 * @version 1.0
 * @date 2020/6/5
 * @since 2020/6/5
 */
public class CommonService {
    @Resource
    CommonMapper commonMapper;
    int generateCodeByMax(String tableName) {
        String code = commonMapper.getCode(tableName);
        return StringUtils.isBlank(code) ? 0:Integer.parseInt(code) + 1;
    }
}
